package com.spring.common.allocation;


import com.cloopen.rest.sdk.CCPRestSmsSDK;

/**
 * Created by anpushang on 2016/9/28.
 */
public class RLSMSExposer {

    private static final String subAccountSid = "8a48b551506fd26f01507f16d7a52533";//子帐号

    private static final String subAccountToken = "246ed57917ca4e608afa126af0411ebb";//子帐号token

    private static final String appId = "8aaf070857514dd70157645eeb87077d"; // appId

    private static final String serviceAddress = "app.cloopen.com";//服务地址

    private static final String servicePort = "8883";//服务端口

    private static CCPRestSmsSDK restAPI = null;

    public void initRLSMS(){
        createCCPRestSDK();
    }

    public static CCPRestSmsSDK getCCPRestSDKApi(){
        return restAPI != null ? restAPI : createCCPRestSDK();
    }

    public static CCPRestSmsSDK createCCPRestSDK(){
        restAPI = new CCPRestSmsSDK();
        restAPI.init(serviceAddress,servicePort);
        restAPI.setAccount(subAccountSid,subAccountToken);
        restAPI.setAppId(appId);
        return restAPI;
    }

}
